package org.threebitsoftware.tbb.dao;

import org.apache.log4j.Logger;
import org.threebitsoftware.dao.generated.AppUser;
import org.threebitsoftware.tbb.dao.Contact;

/*
 * Created: Nov 14, 2009
 * Original Author: Elwin
 * Project:
 * Copyright:
 * 
 * Purpose:
 */

/*
 * Copyright (c) 2009, 3BitSoftware
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *   * Redistributions of source code must retain the above copyright
 *     notice, this list of conditions and the following disclaimer.
 *   * Redistributions in binary form must reproduce the above copyright
 *     notice, this list of conditions and the following disclaimer in the
 *     documentation and/or other materials provided with the distribution.
 *   * Neither the name of the <organization> nor the
 *     names of its contributors may be used to endorse or promote products
 *     derived from this software without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY <copyright holder> ''AS IS'' AND ANY
 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
 * DISCLAIMED. IN NO EVENT SHALL <copyright holder> BE LIABLE FOR ANY
 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */

/*
 * Contains static information needed by the test cases.
 */
public class TestInformation {
	private static Logger cLogger = Logger.getLogger(TestInformation.class);
	
	
	static AppUser TEST_APP_USER = null;
	static Contact TEST_DOMAIN_CONTACT = null;
	static PhoneNumber TEST_DOMAIN_PHONENUMBER = null;
	static EmailAddress TEST_DOMAIN_EMAIL = null;
	static Address TEST_DOMAIN_ADDRESS = null;
	static TagForContact TEST_TAG = null;
	
	private static void setupObjects() {
		cLogger.debug("Setting up static information for testing.");
		
		TEST_APP_USER = new AppUser();
		TEST_APP_USER.setIdAppUser(-2);
		TEST_APP_USER.setSNameFirst("Test_First");
		TEST_APP_USER.setSNameMiddle("TM");
		TEST_APP_USER.setSNameLast("Test_Last Name");
		TEST_APP_USER.setSPassword("passwd");
		TEST_APP_USER.setSUsername("testuser");
		
		TEST_DOMAIN_ADDRESS = new Address("Street1", null, null, "USA", "zipTest", "StateSOmewhere", "SomeCity", "Homeadr");
		
	}
	
	public static PhoneNumber getDomainPhoneNumber()
	{
		TEST_DOMAIN_PHONENUMBER = new PhoneNumber("1-99-999-999-99999", "Home");
		return TEST_DOMAIN_PHONENUMBER;
	}
	
	public static Contact getContact()
	{
		setupObjects();
		TEST_DOMAIN_CONTACT = new Contact("Test First", "Test Last", "Test Middle", "", "Mr. / Mrs.", null, null, true);
		TEST_DOMAIN_CONTACT.setIdAppUser(new Long(TEST_APP_USER.getIdAppUser()).intValue());
		TEST_DOMAIN_CONTACT.setIdContact(-2);
		
		return TEST_DOMAIN_CONTACT;
	}
	
	public static EmailAddress getDomainEmailAdress()
	{
		TEST_DOMAIN_EMAIL = new EmailAddress("something@somewhere.com", "personal");
		return TEST_DOMAIN_EMAIL;
	}
	
	public static Address getDomainAddress()
	{
		TEST_DOMAIN_ADDRESS = new Address("Street1", null, null, "USA", "zipTest", "StateSOmewhere", "SomeCity", "Homeadr");
		return TEST_DOMAIN_ADDRESS;
	}
	
	public static TagForContact getDomainTag()
	{
		TEST_TAG = new TagForContact();
		TEST_TAG.setSTag("myTestTag");
		
		return TEST_TAG;
	}

}
